/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 东莞呵呵
 * Date:2022-03-28
 * Time:16:21
 */
public class TestDemo {
    public static String myToString(int[] arr){
        if(arr==null){
            return null;
        }
        String str="[";
        for (int i = 0; i < arr.length; i++) {
            str+=arr[i];
            if(i!=arr.length-1){
                str+=",";
            }
        }
        str+="]";
        return str;
    }

    public static void main(String[] args) {
        int []arr={1,2,3,4,5};
        System.out.println(myToString(arr));
    }
}
